<template>
	<el-drawer title="档案详情" v-model="visible" :size="600" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form-item label="档案标题" prop="title">{{form.title}}</el-form-item>
				<el-row :gutter="24">
					<el-col :lg="12">
						<el-form-item label="采集类型" prop="archivesEnterType">{{form.archivesEnterTypeName}}</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="档案来源" prop="archivesSource">{{form.archivesSourceName}}</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="24">
					<el-col :lg="12">
						<el-form-item label="文件数量" prop="fileQuantity">{{form.fileQuantity}}/份</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="文件页数" prop="pages">{{form.pages}}/页
						</el-form-item>
					</el-col>
				</el-row>
				<el-form-item label="档案摘要" prop="subject">{{form.subject}}</el-form-item>
				<el-form-item label="备注说明" prop="remark">{{form.remark}}</el-form-item>
				<el-form-item label="档案文件" prop="attachId">
					<attach-menu :attachIds="form.attachId" :roleFlag="3" :preview="true"></attach-menu>
				</el-form-item>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>
<script>

import AttachMenu from "@/views/module/attachMenu.vue";

export default {
	emits: ['success', 'closed'],
	components: {AttachMenu},
	data() {
		return {
			visible: false,
			isSaveing: false,
			loading:false,
			//所需数据选项
			form: {
				recordId:'',
				title: '',
				archivesEnterTypeName: '',
				archivesSourceName: '',
				fileQuantity: 0,
				pages: 0,
				subject:'',
				remark: '',
				attachId:'',
			}
		}
	},
	mounted() {
	},
	methods: {
		open() {
			this.visible = true;
			return this
		},
		setData(data) {
			this.form.recordId = data.recordId
			this.form.title = data.title
			this.form.archivesEnterTypeName = data.archivesEnterTypeName
			this.form.archivesSourceName = data.archivesSourceName
			this.form.fileQuantity = data.fileQuantity
			this.form.pages = data.pages
			this.form.subject = data.subject
			this.form.remark = data.remark
			this.form.attachId = data.attachId
		},
	}
}
</script>

<style>
.customWidth {
	width: 60%;
}
</style>
